<%@ Register TagPrefix="cc2" Namespace="PHSRAG.WebControls" Assembly="PHSRAG.WebControls" %>

<%@ Page Language="c#" Inherits="PHSRAG.Insight21.Humans.AttachmentVersionsPage"
    CodeFile="AttachmentVersions.aspx.cs" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>AttachmentVersions</title>
    <link href="../Insight21.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="../scripts/AttachmentVersions.js"></script>
</head>
<body>
    <form method="post" id="AttachmentVersionsForm" runat="server">
        <table>
            <tr>
                <td>
                    <cc2:PostbackGuard ID="postbackGuard" runat="server"></cc2:PostbackGuard>
                </td>
            </tr>
        </table>
        <table id="dynamicTable" cellspacing="10" class="Invisible">
            <tr>
                <td>
                    <cc2:ActivityIndicator ID="activityIndicator" ContainerID="dynamicTable" runat="server">
                    </cc2:ActivityIndicator>
                </td>
            </tr>
            <tr>
                <td>
                    <cc2:Annunciator ID="annunciator" ContainerID="dynamicTable" runat="server"></cc2:Annunciator>
                </td>
            </tr>
        </table>
        <table id="main" width="100%" border="0">
            <tr>
                <td>
                    <input id="selectedRowsForDifferences" type="hidden" name="selectedRowsForDifferences" />
                </td>
            </tr>
            <tr>
                <td>
                    <table width="100%" border="0">
                        <tr>
                            <td align="left">
                                Attachment Title:&nbsp;<strong><asp:Label ID="attachmentTitle" runat="server"></asp:Label></strong></td>
                            <td align="right">
                                Attachment Type:&nbsp;<strong><asp:Label ID="attachmentType" runat="server"></asp:Label></strong></td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr id="gridRow">
                <td>
                    <table cellspacing="0" class="HumansStaff">
                        <tr>
                            <td>
                                <asp:DataGrid ID="versionsDetail" runat="server" AutoGenerateColumns="False" CssClass="DataGrid"
                                    OnItemCommand="OnVersionsDetailItemCommand" OnItemDataBound="OnVersionsDetailItemDataBound"
                                    OnPreRender="OnVersionsDetailPreRender" Width="100%">
                                    <AlternatingItemStyle CssClass="DataGridAlternatingItem"></AlternatingItemStyle>
                                    <ItemStyle CssClass="DataGridItem"></ItemStyle>
                                    <HeaderStyle CssClass="DataGridHeader"></HeaderStyle>
                                    <Columns>
                                        <asp:BoundColumn Visible="False" DataField="Id" HeaderText="ProtocolDocId"></asp:BoundColumn>
                                        <asp:BoundColumn Visible="False" DataField="DocumentId" HeaderText="DocumentId"></asp:BoundColumn>
                                        <asp:TemplateColumn HeaderText="Select Files">
                                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="fileToDiff" runat="server"></asp:CheckBox>
                                            </ItemTemplate>
                                        </asp:TemplateColumn>
                                        <asp:TemplateColumn HeaderText="Attachment Mode">
                                            <ItemTemplate>
                                                <asp:Label ID="attachmentMode" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateColumn>
                                         <asp:TemplateColumn HeaderText="Title">
                                            <ItemTemplate>
                                                <asp:Label ID="titleName" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateColumn>
                                        <asp:BoundColumn DataField="FileName" HeaderText="File Name"></asp:BoundColumn>
                                        <asp:TemplateColumn HeaderText="Date Uploaded">
                                            <ItemTemplate>
                                                <asp:Label ID="attachmentDateUploaded" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateColumn>
                                        <asp:TemplateColumn HeaderText="View Attachment">
                                            <ItemStyle HorizontalAlign="Center" Height="10px"></ItemStyle>
                                            <ItemTemplate>
                                                <asp:ImageButton ID="viewAttachment" runat="server" Height="20px" CommandName="ImageClick"
                                                    Visible="false"></asp:ImageButton>
                                            </ItemTemplate>
                                        </asp:TemplateColumn>
                                        <asp:TemplateColumn HeaderText="Mark for Deletion">
                                            <ItemStyle HorizontalAlign="Center" Width="70px" />
                                            <ItemTemplate>
                                                <asp:CheckBox ID="attachmentMarkForDelete" runat="server" />
                                            </ItemTemplate>
                                        </asp:TemplateColumn>
                                    </Columns>
                                </asp:DataGrid>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <!-- gridRow -->
            <tr>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <table width="100%" border="0">
                        <tr>
                            <td align="left" valign="top" style="height: 29px">
                                <asp:ImageButton ID="showDifferences" runat="server" ImageUrl="../Images/b_show_diff.gif"
                                    OnClick="OnShowDifferencesClick" /></td>
                            <td align="right" style="height: 29px">
                                <asp:ImageButton ID="addReplaceVersion" runat="server" ImageUrl="../Images/b_add_new_version_grey.gif"
                                    OnClick="OnAddReplaceVersionClick" />
                                <asp:ImageButton ID="deleteVersion" runat="server" ImageUrl="../Images/b_delete_gray.gif"
                                    OnClick="OnDeleteVersion" />
                                &nbsp;
                                <input onclick="javascript:window.opener.RefreshWindow();window.close();" src="../Images/b_close_grey.gif"
                                    type="image" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
            </tr>
            <tr id="AddNewVersion">
                <td>
                    <asp:Panel ID="addNewVersionSection" runat="server" Visible="False">
                        <table cellspacing="0" cellpadding="0" border="0">
                            <tr>
                                <td style="background-color:silver" colspan="3">
                                    Add Version</td>
                            </tr>
                            <tr>
                                <td style="height:10px">
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" style="width:150px;height:25px">
                                    Attachment Mode:</td>
                                <td align="left" style="height:25px">
                                    <asp:CheckBox ID="attachmentElectronic" 
                                        runat="server" Text="Electronic"></asp:CheckBox>&nbsp;
                                    <asp:CheckBox ID="attachmentHardCopy"
                                        runat="server" Text="Hardcopy"></asp:CheckBox>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td style="height:10px">
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td style="height:10px">Title:
                                </td>
                                <td>
                                    <asp:TextBox ID="newTitle" runat="server" disabled="true"></asp:TextBox> 
                                </td>
                                <td>Enter the document title and version number/date or for consent forms, enter the description of the study population.
                                </td>
                            </tr>
                            <tr>
                                <td style="height:10px">
                                </td>
                                <td></td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td style="width:150px">
                                    Select File</td>
                                <td>
                                    <input class="FlatTextBox" id="attachedFile" disabled="disabled" type="file" runat="server" /></td>
                            </tr>
                            <tr>
                                <td style="height:10px">
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" colspan="2">
                                    <asp:ImageButton ID="uploadVersion" runat="server" ImageUrl="../Images/b_save_grey.gif"
                                        OnClick="OnUploadVersionClick" OnClientClick="return Validate();" /></td>
                            </tr>                            
				</tr>
                        </table>                        
                    </asp:Panel>
                </td>
            </tr>
            <!-- AddNewVersion -->
        </table>
        <!-- main -->
    </form>
</body>
</html>
